package designMode.factory.simple;

import designMode.factory.AliPay;
import designMode.factory.Pay;
import designMode.factory.WechatPay;

/**
 * @Author 肖地洋
 * @Date 2022/8/13 10:00
 */
public class PaySimpleFactory {

   public static Pay creatPay(String type){
        if(type==null){
            return null;
        }else if(type.equalsIgnoreCase("ALI_PAY")){
            return new AliPay();
        }else if(type.equalsIgnoreCase("WECHAT_PAY")){
            return new WechatPay();
        }else{
            return null;
        }
    }

}
